package com.bingxue.edu.management.system.model.req;

import com.bingxue.edu.common.enums.OrgTypeEnum;
import com.bingxue.edu.common.enums.CommonStatusEnum;
import com.bingxue.edu.framework.common.validation.Code;
import com.bingxue.edu.framework.common.validation.Name;
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.Length;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 创建或修改组织信息
 *
 * @author panbo
 * @since 2024/07/12 17:24
 */
@Data
@Schema(description = "创建或修改组织信息")
public class OrgReq {

    @Schema(description = "上级id")
    @NotBlank(message = "上级id不能为空")
    @Length(max = 32, message = "上级id长度不能超过 {max} 个字符")
    private String parentId;

    @Schema(description = "编码")
    @Code
    private String code;

    @Schema(description = "名称")
    @Name
    private String name;

    @Schema(description = "简称")
    @Length(max = 24, message = "简称长度不能超过 {max} 个字符")
    private String shortName;

    @Schema(description = "组织类型")
    @NotNull(message = "组织类型不能为空")
    private OrgTypeEnum orgType;

    @Schema(description = "负责人")
    @Length(max = 32, message = "负责人id长度不能超过 {max} 个字符")
    private String leaderId;

    @Schema(description = "电话号码")
    private String telephone;

    @Schema(description = "地址")
    @Length(max = 255, message = "名称长度不能超过 {max} 个字符")
    private String address;

    @Schema(description = "排序号")
    private Integer sort;

    @Schema(description = "状态")
    @NotNull(message = "状态不能为空")
    private CommonStatusEnum status;
}
